/**
 * @Classname ThreadedBinaryTreeDemo 线索化二叉树
 * @Description TODO
 * @Date 2021/12/23 9:57
 * @Created K024851
 */
public class ThreadedBinaryTreeDemo {
    public static void main(String[] args) {
        HeroNode root = new HeroNode(1,"tom");
        HeroNode node2 = new HeroNode(3,"jack");
        HeroNode node3 = new HeroNode(6,"smith");
        HeroNode node4 = new HeroNode(8,"mary");
        HeroNode node5 = new HeroNode(10,"king");
        HeroNode node6 = new HeroNode(14,"dim");

        root.setLeft(node2);
        root.setRight(node3);
        node2.setLeft(node4);
        node2.setRight(node5);
        node3.setLeft(node6);
    }
}
class ThreadedBinaryTree{
    private HeroNode root;
    private HeroNode pre = null;

    public void setRoot(HeroNode root) {
        this.root = root;
    }
    public void threadedNodes(){
        this.threadedNodes(root);
    }
    public void threadedList(){
        HeroNode node = root;
    }

    public void threadedNodes(HeroNode node){
        if (node ==null){
            return;
        }
        threadedNodes(node.getLeft());

        if (node.getLeft() ==null){
            node.setLeft(pre);


        }

    }
}
